{include file="header.html"}

<div class="page-header">
	<h6>
		优惠劵sn列表管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			优惠劵sn列表
		</small>
	</h6>
</div><!-- /.page-header -->

<form class="form-inline" action="?" method="get">
<input type="hidden" name="app" id="app" value="coupon" />
<input type="hidden" name="act" id="act" value="sn" />
<input type="hidden" name="coupon_id" id="coupon_id" value="{$coupon_id}" />
<input type="text" class="input-medium" placeholder="关键词" name="keyword" value="{$keyword}" /> 
<select name="status" id="status" class="form-control">
	<option value="">状态</option>
	<option value="1" {if $status==='1'}selected{/if}>正常</option>
	<option value="-1" {if $status==='-1'}selected{/if}>已使用</option>
	<option value="-2" {if $status==='-2'}selected{/if}>已过期</option>
</select> 

<input type="date" class="form-control" name="get_time1" id="get_time1" placeholder="领取日期" value="{$get_time1}" initdate="" style="width:150px;" />
 -
<input type="date" class="form-control" name="get_time2" id="get_time2" placeholder="领取日期" value="{$get_time2}" initdate="" style="width:150px;" />
<input type="date" class="form-control" name="use_time1" id="use_time1" placeholder="使用日期" value="{$use_time1}" initdate="" style="width:150px;" />
 -
<input type="date" class="form-control" name="use_time2" id="use_time2" placeholder="使用日期" value="{$use_time2}" initdate="" style="width:150px;" />
<button type="submit" class="btn btn-info btn-sm">
	<i class="ace-icon fa fa-search bigger-110"></i>搜索
</button>
</form>
<table id="simple-table" class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>ID</th>
			<th>优惠劵面值</th>
			<th>sn码</th>
			<th>领取人</th>
			<th>领取时间</th>
			<th>使用时间</th>
			<th>状态</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		{foreach from = $rs item=row }
		<tr>
			<td>{$row.id}</td>
			<td>{$row.coupon_money}</td>
			<td>{$row.sn}</td>
			<td>{if $row.nick_name}{$row.nick_name}{else}{$row.name}{/if}</td>
			<td> {if $row.get_time > 0}{$row.get_time|date_format:"%Y-%m-%d"}{else}未领取{/if}</td>
			<td>{if $row.use_time > 0}{$row.use_time|date_format:"%Y-%m-%d"}{else}未使用{/if}</td>
			<td>{if $row.status == 1} 正常 {else if $row.status == -1} 已使用 {else}已过期 {/if}</td>
			<td>{$row.add_time|date_format:"%Y-%m-%d"}</td>
			<td>
				<a href="?app=coupon&act=edit_sn&id={$row.id}">
					<button class="btn btn-xs btn-info">
					<i class="ace-icon fa fa-pencil bigger-120"></i>
				</button>
				</a>
				<a href="?app=coupon&act=delete_sn&id={$row.id}" class="delete">
					<button class="btn btn-xs btn-danger">
					<i class="ace-icon fa fa-trash-o bigger-120"></i>
				</button>
				</a>
			</td>
		</tr>
		{foreachelse}
		<tr bgcolor="white"><td colspan="13" height="50">暂无记录</td></tr>
		{/foreach}	
		
	</tbody>
</table>
	<div class="mypage" style="text-align:right">
			共 {$page.num_records} 个记录  {$page.current_page} / {$page.num_pages} 页  {$page.first_page} {$page.prev} {$page.nav} {$page.next} {$page.last_page}
	</div>
{include file="footer.html"}
<script type="text/javascript">
    $(function(){
	$('#get_time1').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
	$('#get_time2').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
	$('#use_time1').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
	$('#use_time2').datepicker({
		useStyle:'datepicker2',
		readonly:false,
		showTime:true,
		showSecond:false,
		format:'yyyy-mm-dd hh:mm'
	});
});
</script>